# -*- coding: utf-8 -*-

"""
@author: 猿小天
@contact: QQ:1638245306
@Created on: 2021/6/3 003 0:30
@Remark: 按钮权限管理
"""
from super.system.models import Form
from super.utils.serializers import CustomModelSerializer
from super.utils.viewset import CustomModelViewSet


class FormSerializer(CustomModelSerializer):
    """
    按钮权限-序列化器
    """

    class Meta:
        model = Form
        fields = "__all__"
        read_only_fields = ["id"]


class FormViewSet(CustomModelViewSet):
    """
    按钮权限接口
    list:查询
    create:新增
    update:修改
    retrieve:单例
    destroy:删除
    """
    queryset = Form.objects.all()
    serializer_class = FormSerializer
    filter_fields = ('name', )
